import List from "@/model/list";
import {FormInstance} from "element-plus";

export default class Search {

    info: any;
    list?: List;
    searchRef?:FormInstance;
    defaultInfo:any;

    constructor({
                    info = {},
                    list = undefined,
                    searchRef = undefined,
                }: {
        list?: List,
        info?: any,
        searchRef?: FormInstance,
    }) {
        this.list = list
        this.info = {...info}
        this.defaultInfo = {...info}
    }

    submit() {
        // 查询
        this.list?.search(this.info)
    }

    reset() {
        // this.searchRef!.resetFields()
        this.info = {...this.defaultInfo}
        console.log("search", this.info)
    }

}
